home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / jpeglib5b / configure < prev    next >
Text File  |  1980-01-12  |  44KB  |  1,595 lines

  1. #!/bin/sh
  2.  
  3. # Guess values for system-dependent variables and create Makefiles.
  4. # Generated automatically using autoconf version 2.1 
  5. # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
  6. #
  7. # This configure script is free software; the Free Software Foundation
  8. # gives unlimited permission to copy, distribute and modify it.
  9.  
  10. # Defaults:
  11. ac_help=
  12. ac_default_prefix=/usr/local
  13. # Any additions from configure.in:
  14. ac_help="$ac_help
  15.   --enable-maxmem[=N]     enable use of temp files, set max mem usage to N MB"
  16. ac_help="$ac_help
  17. "
  18.  
  19. # Initialize some variables set by options.
  20. # The variables have the same names as the options, with
  21. # dashes changed to underlines.
  22. build=NONE
  23. cache_file=./config.cache
  24. exec_prefix=NONE
  25. host=NONE
  26. no_create=
  27. nonopt=NONE
  28. no_recursion=
  29. prefix=NONE
  30. program_prefix=NONE
  31. program_suffix=NONE
  32. program_transform_name=s,x,x,
  33. silent=
  34. site=
  35. srcdir=
  36. target=NONE
  37. verbose=
  38. x_includes=NONE
  39. x_libraries=NONE
  40.  
  41. # Initialize some other variables.
  42. subdirs=
  43.  
  44. ac_prev=
  45. for ac_option
  46. do
  47.  
  48.   # If the previous option needs an argument, assign it.
  49.   if test -n "$ac_prev"; then
  50.     eval "$ac_prev=\$ac_option"
  51.     ac_prev=
  52.     continue
  53.   fi
  54.  
  55.   case "$ac_option" in
  56.   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  57.   *) ac_optarg= ;;
  58.   esac
  59.  
  60.   # Accept the important Cygnus configure options, so we can diagnose typos.
  61.  
  62.   case "$ac_option" in
  63.  
  64.   -build | --build | --buil | --bui | --bu | --b)
  65.     ac_prev=build ;;
  66.   -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  67.     build="$ac_optarg" ;;
  68.  
  69.   -cache-file | --cache-file | --cache-fil | --cache-fi \
  70.   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  71.     ac_prev=cache_file ;;
  72.   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  73.   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  74.     cache_file="$ac_optarg" ;;
  75.  
  76.   -disable-* | --disable-*)
  77.     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
  78.     # Reject names that are not valid shell variable names.
  79.     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
  80.       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
  81.     fi
  82.     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
  83.     eval "enable_${ac_feature}=no" ;;
  84.  
  85.   -enable-* | --enable-*)
  86.     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
  87.     # Reject names that are not valid shell variable names.
  88.     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
  89.       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
  90.     fi
  91.     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
  92.     case "$ac_option" in
  93.       *=*) ;;
  94.       *) ac_optarg=yes ;;
  95.     esac
  96.     eval "enable_${ac_feature}='$ac_optarg'" ;;
  97.  
  98.   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  99.   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  100.   | --exec | --exe | --ex)
  101.     ac_prev=exec_prefix ;;
  102.   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  103.   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  104.   | --exec=* | --exe=* | --ex=*)
  105.     exec_prefix="$ac_optarg" ;;
  106.  
  107.   -gas | --gas | --ga | --g)
  108.     # Obsolete; use --with-gas.
  109.     with_gas=yes ;;
  110.  
  111.   -help | --help | --hel | --he)
  112.     # Omit some internal or obsolete options to make the list less imposing.
  113.     # This message is too long to be a string in the A/UX 3.1 sh.
  114.     cat << EOF
  115. Usage: configure [options] [host]
  116. Options: [defaults in brackets after descriptions]
  117. Configuration:
  118.   --cache-file=FILE       cache test results in FILE
  119.   --help                  print this message
  120.   --no-create             do not create output files
  121.   --quiet, --silent       do not print \`checking...' messages
  122.   --version               print the version of autoconf that created configure
  123. Directory and file names:
  124.   --prefix=PREFIX         install architecture-independent files in PREFIX
  125.                           [$ac_default_prefix]
  126.   --exec-prefix=PREFIX    install architecture-dependent files in PREFIX
  127.                           [same as prefix]
  128.   --srcdir=DIR            find the sources in DIR [configure dir or ..]
  129.   --program-prefix=PREFIX prepend PREFIX to installed program names
  130.   --program-suffix=SUFFIX append SUFFIX to installed program names
  131.   --program-transform-name=PROGRAM run sed PROGRAM on installed program names
  132. Host type:
  133.   --build=BUILD           configure for building on BUILD [BUILD=HOST]
  134.   --host=HOST             configure for HOST [guessed]
  135.   --target=TARGET         configure for TARGET [TARGET=HOST]
  136. Features and packages:
  137.   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  138.   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  139.   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  140.   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  141.   --x-includes=DIR        X include files are in DIR
  142.   --x-libraries=DIR       X library files are in DIR
  143. --enable and --with options recognized:$ac_help
  144. EOF
  145.     exit 0 ;;
  146.  
  147.   -host | --host | --hos | --ho)
  148.     ac_prev=host ;;
  149.   -host=* | --host=* | --hos=* | --ho=*)
  150.     host="$ac_optarg" ;;
  151.  
  152.   -nfp | --nfp | --nf)
  153.     # Obsolete; use --without-fp.
  154.     with_fp=no ;;
  155.  
  156.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  157.   | --no-cr | --no-c)
  158.     no_create=yes ;;
  159.  
  160.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  161.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
  162.     no_recursion=yes ;;
  163.  
  164.   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  165.     ac_prev=prefix ;;
  166.   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  167.     prefix="$ac_optarg" ;;
  168.  
  169.   -program-prefix | --program-prefix | --program-prefi | --program-pref \
  170.   | --program-pre | --program-pr | --program-p)
  171.     ac_prev=program_prefix ;;
  172.   -program-prefix=* | --program-prefix=* | --program-prefi=* \
  173.   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  174.     program_prefix="$ac_optarg" ;;
  175.  
  176.   -program-suffix | --program-suffix | --program-suffi | --program-suff \
  177.   | --program-suf | --program-su | --program-s)
  178.     ac_prev=program_suffix ;;
  179.   -program-suffix=* | --program-suffix=* | --program-suffi=* \
  180.   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  181.     program_suffix="$ac_optarg" ;;
  182.  
  183.   -program-transform-name | --program-transform-name \
  184.   | --program-transform-nam | --program-transform-na \
  185.   | --program-transform-n | --program-transform- \
  186.   | --program-transform | --program-transfor \
  187.   | --program-transfo | --program-transf \
  188.   | --program-trans | --program-tran \
  189.   | --progr-tra | --program-tr | --program-t)
  190.     ac_prev=program_transform_name ;;
  191.   -program-transform-name=* | --program-transform-name=* \
  192.   | --program-transform-nam=* | --program-transform-na=* \
  193.   | --program-transform-n=* | --program-transform-=* \
  194.   | --program-transform=* | --program-transfor=* \
  195.   | --program-transfo=* | --program-transf=* \
  196.   | --program-trans=* | --program-tran=* \
  197.   | --progr-tra=* | --program-tr=* | --program-t=*)
  198.     program_transform_name="$ac_optarg" ;;
  199.  
  200.   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  201.   | -silent | --silent | --silen | --sile | --sil)
  202.     silent=yes ;;
  203.  
  204.   -site | --site | --sit)
  205.     ac_prev=site ;;
  206.   -site=* | --site=* | --sit=*)
  207.     site="$ac_optarg" ;;
  208.  
  209.   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  210.     ac_prev=srcdir ;;
  211.   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  212.     srcdir="$ac_optarg" ;;
  213.  
  214.   -target | --target | --targe | --targ | --tar | --ta | --t)
  215.     ac_prev=target ;;
  216.   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  217.     target="$ac_optarg" ;;
  218.  
  219.   -v | -verbose | --verbose | --verbos | --verbo | --verb)
  220.     verbose=yes ;;
  221.  
  222.   -version | --version | --versio | --versi | --vers)
  223.     echo "configure generated by autoconf version 2.1"
  224.     exit 0 ;;
  225.  
  226.   -with-* | --with-*)
  227.     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
  228.     # Reject names that are not valid shell variable names.
  229.     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
  230.       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
  231.     fi
  232.     ac_package=`echo $ac_package| sed 's/-/_/g'`
  233.     case "$ac_option" in
  234.       *=*) ;;
  235.       *) ac_optarg=yes ;;
  236.     esac
  237.     eval "with_${ac_package}='$ac_optarg'" ;;
  238.  
  239.   -without-* | --without-*)
  240.     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
  241.     # Reject names that are not valid shell variable names.
  242.     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  243.       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
  244.     fi
  245.     ac_package=`echo $ac_package| sed 's/-/_/g'`
  246.     eval "with_${ac_package}=no" ;;
  247.  
  248.   --x)
  249.     # Obsolete; use --with-x.
  250.     with_x=yes ;;
  251.  
  252.   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  253.   | --x-incl | --x-inc | --x-in | --x-i)
  254.     ac_prev=x_includes ;;
  255.   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  256.   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
  257.     x_includes="$ac_optarg" ;;
  258.  
  259.   -x-libraries | --x-libraries | --x-librarie | --x-librari \
  260.   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  261.     ac_prev=x_libraries ;;
  262.   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  263.   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  264.     x_libraries="$ac_optarg" ;;
  265.  
  266.   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
  267.     ;;
  268.  
  269.   *=*)
  270.     varname=`echo "$ac_option"|sed -e 's/=.*//'`
  271.     # Reject names that aren't valid shell variable names.
  272.     if test -n "`echo $varname| sed 's/[a-zA-Z0-9_]//g'`"; then
  273.       { echo "configure: error: $varname: invalid shell variable name" 1>&2; exit 1; }
  274.     fi
  275.     val="`echo "$ac_option"|sed 's/[^=]*=//'`"
  276.     test -n "$verbose" && echo "    setting shell variable $varname to $val"
  277.     eval "$varname='$val'"
  278.     eval "export $varname" ;;
  279.  
  280.   *) 
  281.     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
  282.       echo "configure: warning: $ac_option: invalid host type" 1>&2
  283.     fi
  284.     if test "x$nonopt" != xNONE; then
  285.       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
  286.     fi
  287.     nonopt="$ac_option"
  288.     ;;
  289.  
  290.   esac
  291. done
  292.  
  293. if test -n "$ac_prev"; then
  294.   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
  295. fi
  296.  
  297. trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
  298.  
  299. # File descriptor usage:
  300. # 0 unused; standard input
  301. # 1 file creation
  302. # 2 errors and warnings
  303. # 3 unused; some systems may open it to /dev/tty
  304. # 4 checking for... messages and results
  305. # 5 compiler messages saved in config.log
  306. if test "$silent" = yes; then
  307.   exec 4>/dev/null
  308. else
  309.   exec 4>&1
  310. fi
  311. exec 5>./config.log
  312.  
  313. echo "\
  314. This file contains any messages produced by compilers while
  315. running configure, to aid debugging if configure makes a mistake.
  316. " 1>&5
  317.  
  318. # Strip out --no-create and --no-recursion so they do not pile up.
  319. # Also quote any args containing shell metacharacters.
  320. ac_configure_args=
  321. for ac_arg
  322. do
  323.   case "$ac_arg" in
  324.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  325.   | --no-cr | --no-c) ;;
  326.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  327.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  328.   *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  329.   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  330.   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  331.   esac
  332. done
  333.  
  334. # NLS nuisances.
  335. # Only set LANG and LC_ALL to C if already set.
  336. # These must not be set unconditionally because not all systems understand
  337. # e.g. LANG=C (notably SCO).
  338. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  339. if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  340.  
  341. # confdefs.h avoids OS command line length limits that DEFS can exceed.
  342. rm -rf conftest* confdefs.h
  343. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  344. echo > confdefs.h
  345.  
  346. # A filename unique to this package, relative to the directory that
  347. # configure is in, which we can look for to find out if srcdir is correct.
  348. ac_unique_file=jcmaster.c
  349.  
  350. # Find the source files, if location was not specified.
  351. if test -z "$srcdir"; then
  352.   ac_srcdir_defaulted=yes
  353.   # Try the directory containing this script, then its parent.
  354.   ac_prog=$0
  355.   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  356.   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  357.   srcdir=$ac_confdir
  358.   if test ! -r $srcdir/$ac_unique_file; then
  359.     srcdir=..
  360.   fi
  361. else
  362.   ac_srcdir_defaulted=no
  363. fi
  364. if test ! -r $srcdir/$ac_unique_file; then
  365.   if test "$ac_srcdir_defaulted" = yes; then
  366.     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  367.   else
  368.     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  369.   fi
  370. fi
  371. srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
  372.  
  373. # Prefer explicitly selected file to automatically selected ones.
  374. if test -z "$CONFIG_SITE"; then
  375.   if test "x$prefix" != xNONE; then
  376.     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  377.   else
  378.     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  379.   fi
  380. fi
  381. for ac_site_file in $CONFIG_SITE; do
  382.   if test -r "$ac_site_file"; then
  383.     echo "loading site script $ac_site_file"
  384.     . "$ac_site_file"
  385.   fi
  386. done
  387.  
  388.  
  389. ac_ext=c
  390. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  391. ac_cpp='$CPP $CPPFLAGS'
  392. ac_compile='${CC-cc} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&5 2>&5'
  393. ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&5 2>&5'
  394.  
  395. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  396.   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  397.   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  398.     ac_n= ac_c='
  399. ' ac_t='    '
  400.   else
  401.     ac_n=-n ac_c= ac_t=
  402.   fi
  403. else
  404.   ac_n= ac_c='\c' ac_t=
  405. fi
  406.  
  407.  
  408.  
  409. # Extract the first word of "gcc", so it can be a program name with args.
  410. set dummy gcc; ac_word=$2
  411. echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
  412. if eval "test \"`echo '${'ac_cv_prog_CC'+set}'`\" = set"; then
  413.   echo $ac_n "(cached) $ac_c" 1>&4
  414. else
  415.   if test -n "$CC"; then
  416.   ac_cv_prog_CC="$CC" # Let the user override the test.
  417. else
  418.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  419.   for ac_dir in $PATH; do
  420.     test -z "$ac_dir" && ac_dir=.
  421.     if test -f $ac_dir/$ac_word; then
  422.       ac_cv_prog_CC="gcc"
  423.       break
  424.     fi
  425.   done
  426.   IFS="$ac_save_ifs"
  427.   test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
  428. fi
  429. fi
  430. CC="$ac_cv_prog_CC"
  431. if test -n "$CC"; then
  432.   echo "$ac_t""$CC" 1>&4
  433. else
  434.   echo "$ac_t""no" 1>&4
  435. fi
  436.  
  437.  
  438. echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&4
  439. if eval "test \"`echo '${'ac_cv_prog_gcc'+set}'`\" = set"; then
  440.   echo $ac_n "(cached) $ac_c" 1>&4
  441. else
  442.   cat > conftest.c <<EOF
  443. #ifdef __GNUC__
  444.   yes;
  445. #endif
  446. EOF
  447. if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
  448.   ac_cv_prog_gcc=yes
  449. else
  450.   ac_cv_prog_gcc=no
  451. fi
  452. fi
  453. echo "$ac_t""$ac_cv_prog_gcc" 1>&4
  454. if test $ac_cv_prog_gcc = yes; then
  455.   GCC=yes
  456. else
  457.   GCC=
  458. fi
  459. if test "${CFLAGS+set}" != set; then
  460.   echo $ac_n "checking whether ${CC-cc} accepts -O""... $ac_c" 1>&4
  461. if eval "test \"`echo '${'ac_cv_prog_cc_o'+set}'`\" = set"; then
  462.   echo $ac_n "(cached) $ac_c" 1>&4
  463. else
  464.   echo 'int f(){ return 0; }' > conftest.c
  465. if test -z "`${CC-cc} -O -c conftest.c 2>&1`"; then
  466.   ac_cv_prog_cc_o=yes
  467. else
  468.   ac_cv_prog_cc_o=no
  469. fi
  470. rm -f conftest*
  471.  
  472. fi
  473.   echo "$ac_t""$ac_cv_prog_cc_o" 1>&4
  474.   if test $ac_cv_prog_cc_o = yes; then
  475.     CFLAGS="-O"
  476.   else
  477.     CFLAGS=""
  478.   fi
  479. fi
  480.  
  481. echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&4
  482. # On Suns, sometimes $CPP names a directory.
  483. if test -n "$CPP" && test -d "$CPP"; then
  484.   CPP=
  485. fi
  486. if test -z "$CPP"; then
  487. if eval "test \"`echo '${'ac_cv_prog_CPP'+set}'`\" = set"; then
  488.   echo $ac_n "(cached) $ac_c" 1>&4
  489. else
  490.     # This must be in double quotes, not single quotes, because CPP may get
  491.   # substituted into the Makefile and "${CC-cc}" will confuse make.
  492.   CPP="${CC-cc} -E"
  493.   # On the NeXT, cc -E runs the code through the compiler's parser,
  494.   # not just through cpp.
  495.   cat > conftest.$ac_ext <<EOF
  496. #line 497 "configure"
  497. #include "confdefs.h"
  498. #include <assert.h>
  499. Syntax Error
  500. EOF
  501. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  502. ac_err=`grep -v '^ *+' conftest.out`
  503. if test -z "$ac_err"; then
  504.   :
  505. else
  506.   echo "$ac_err" >&5
  507.   rm -rf conftest*
  508.   CPP="${CC-cc} -E -traditional-cpp"
  509.   cat > conftest.$ac_ext <<EOF
  510. #line 511 "configure"
  511. #include "confdefs.h"
  512. #include <assert.h>
  513. Syntax Error
  514. EOF
  515. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  516. ac_err=`grep -v '^ *+' conftest.out`
  517. if test -z "$ac_err"; then
  518.   :
  519. else
  520.   echo "$ac_err" >&5
  521.   rm -rf conftest*
  522.   CPP=/lib/cpp
  523. fi
  524. rm -f conftest*
  525. fi
  526. rm -f conftest*
  527.   ac_cv_prog_CPP="$CPP"
  528. fi
  529. fi
  530. CPP="$ac_cv_prog_CPP"
  531. echo "$ac_t""$CPP" 1>&4
  532.  
  533. # If we cannot run a trivial program, we must be cross compiling.
  534. echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&4
  535. if eval "test \"`echo '${'ac_cv_c_cross'+set}'`\" = set"; then
  536.   echo $ac_n "(cached) $ac_c" 1>&4
  537. else
  538.   if test "$cross_compiling" = yes; then
  539.   ac_cv_cross=yes
  540. else
  541. cat > conftest.$ac_ext <<EOF
  542. #line 543 "configure"
  543. #include "confdefs.h"
  544. main(){return(0);}
  545. EOF
  546. eval $ac_link
  547. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  548.   ac_cv_c_cross=no
  549. else
  550.   ac_cv_c_cross=yes
  551. fi
  552. fi
  553. rm -fr conftest*
  554. fi
  555. cross_compiling=$ac_cv_c_cross
  556. echo "$ac_t""$ac_cv_c_cross" 1>&4
  557.  
  558. echo $ac_n "checking for function prototypes""... $ac_c" 1>&4
  559. if eval "test \"`echo '${'ijg_cv_have_prototypes'+set}'`\" = set"; then
  560.   echo $ac_n "(cached) $ac_c" 1>&4
  561. else
  562.   cat > conftest.$ac_ext <<EOF
  563. #line 564 "configure"
  564. #include "confdefs.h"
  565.  
  566. int testfunction (int arg1, int * arg2); /* check prototypes */
  567. struct methods_struct {        /* check method-pointer declarations */
  568.   int (*error_exit) (char *msgtext);
  569.   int (*trace_message) (char *msgtext);
  570.   int (*another_method) (void);
  571. };
  572. int testfunction (int arg1, int * arg2) /* check definitions */
  573. { return arg2[arg1]; }
  574. int test2function (void)    /* check void arg list */
  575. { return 0; }
  576.  
  577. int main() { return 0; }
  578. int t() {
  579.  
  580. ; return 0; }
  581. EOF
  582. if eval $ac_compile; then
  583.   rm -rf conftest*
  584.   ijg_cv_have_prototypes=yes
  585. else
  586.   rm -rf conftest*
  587.   ijg_cv_have_prototypes=no
  588. fi
  589. rm -f conftest*
  590.  
  591. fi
  592. echo "$ac_t""$ijg_cv_have_prototypes" 1>&4
  593. if test $ijg_cv_have_prototypes = yes; then
  594.   cat >> confdefs.h <<\EOF
  595. #define HAVE_PROTOTYPES 
  596. EOF
  597.  
  598. else
  599.   echo Your compiler does not seem to know about function prototypes.
  600.   echo Perhaps it needs a special switch to enable ANSI C mode.
  601.   echo If so, we recommend running configure like this:
  602.   echo "   ./configure  CC='cc -switch'"
  603.   echo where -switch is the proper switch.
  604. fi
  605. ac_safe=`echo "stddef.h" | tr './\055' '___'`
  606. echo $ac_n "checking for stddef.h""... $ac_c" 1>&4
  607. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  608.   echo $ac_n "(cached) $ac_c" 1>&4
  609. else
  610.   cat > conftest.$ac_ext <<EOF
  611. #line 612 "configure"
  612. #include "confdefs.h"
  613. #include <stddef.h>
  614. EOF
  615. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  616. ac_err=`grep -v '^ *+' conftest.out`
  617. if test -z "$ac_err"; then
  618.   rm -rf conftest*
  619.   eval "ac_cv_header_$ac_safe=yes"
  620. else
  621.   echo "$ac_err" >&5
  622.   rm -rf conftest*
  623.   eval "ac_cv_header_$ac_safe=no"
  624. fi
  625. rm -f conftest*
  626. fi
  627. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  628.   echo "$ac_t""yes" 1>&4
  629.   cat >> confdefs.h <<\EOF
  630. #define HAVE_STDDEF_H 
  631. EOF
  632.  
  633. else
  634.   echo "$ac_t""no" 1>&4
  635. fi
  636.  
  637. ac_safe=`echo "stdlib.h" | tr './\055' '___'`
  638. echo $ac_n "checking for stdlib.h""... $ac_c" 1>&4
  639. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  640.   echo $ac_n "(cached) $ac_c" 1>&4
  641. else
  642.   cat > conftest.$ac_ext <<EOF
  643. #line 644 "configure"
  644. #include "confdefs.h"
  645. #include <stdlib.h>
  646. EOF
  647. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  648. ac_err=`grep -v '^ *+' conftest.out`
  649. if test -z "$ac_err"; then
  650.   rm -rf conftest*
  651.   eval "ac_cv_header_$ac_safe=yes"
  652. else
  653.   echo "$ac_err" >&5
  654.   rm -rf conftest*
  655.   eval "ac_cv_header_$ac_safe=no"
  656. fi
  657. rm -f conftest*
  658. fi
  659. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  660.   echo "$ac_t""yes" 1>&4
  661.   cat >> confdefs.h <<\EOF
  662. #define HAVE_STDLIB_H 
  663. EOF
  664.  
  665. else
  666.   echo "$ac_t""no" 1>&4
  667. fi
  668.  
  669. ac_safe=`echo "string.h" | tr './\055' '___'`
  670. echo $ac_n "checking for string.h""... $ac_c" 1>&4
  671. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  672.   echo $ac_n "(cached) $ac_c" 1>&4
  673. else
  674.   cat > conftest.$ac_ext <<EOF
  675. #line 676 "configure"
  676. #include "confdefs.h"
  677. #include <string.h>
  678. EOF
  679. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  680. ac_err=`grep -v '^ *+' conftest.out`
  681. if test -z "$ac_err"; then
  682.   rm -rf conftest*
  683.   eval "ac_cv_header_$ac_safe=yes"
  684. else
  685.   echo "$ac_err" >&5
  686.   rm -rf conftest*
  687.   eval "ac_cv_header_$ac_safe=no"
  688. fi
  689. rm -f conftest*
  690. fi
  691. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  692.   echo "$ac_t""yes" 1>&4
  693.   :
  694. else
  695.   echo "$ac_t""no" 1>&4
  696. cat >> confdefs.h <<\EOF
  697. #define NEED_BSD_STRINGS 
  698. EOF
  699.  
  700. fi
  701.  
  702. echo $ac_n "checking for size_t""... $ac_c" 1>&4
  703. cat > conftest.$ac_ext <<EOF
  704. #line 705 "configure"
  705. #include "confdefs.h"
  706.  
  707. #ifdef HAVE_STDDEF_H
  708. #include <stddef.h>
  709. #endif
  710. #ifdef HAVE_STDLIB_H
  711. #include <stdlib.h>
  712. #endif
  713. #include <stdio.h>
  714. #ifdef NEED_BSD_STRINGS
  715. #include <strings.h>
  716. #else
  717. #include <string.h>
  718. #endif
  719. typedef size_t my_size_t;
  720.  
  721. int main() { return 0; }
  722. int t() {
  723.  my_size_t foovar; 
  724. ; return 0; }
  725. EOF
  726. if eval $ac_compile; then
  727.   rm -rf conftest*
  728.   ijg_size_t_ok=yes
  729. else
  730.   rm -rf conftest*
  731.   ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"
  732. fi
  733. rm -f conftest*
  734.  
  735. echo "$ac_t""$ijg_size_t_ok" 1>&4
  736. if test "$ijg_size_t_ok" != yes; then
  737. ac_safe=`echo "sys/types.h" | tr './\055' '___'`
  738. echo $ac_n "checking for sys/types.h""... $ac_c" 1>&4
  739. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  740.   echo $ac_n "(cached) $ac_c" 1>&4
  741. else
  742.   cat > conftest.$ac_ext <<EOF
  743. #line 744 "configure"
  744. #include "confdefs.h"
  745. #include <sys/types.h>
  746. EOF
  747. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  748. ac_err=`grep -v '^ *+' conftest.out`
  749. if test -z "$ac_err"; then
  750.   rm -rf conftest*
  751.   eval "ac_cv_header_$ac_safe=yes"
  752. else
  753.   echo "$ac_err" >&5
  754.   rm -rf conftest*
  755.   eval "ac_cv_header_$ac_safe=no"
  756. fi
  757. rm -f conftest*
  758. fi
  759. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  760.   echo "$ac_t""yes" 1>&4
  761.   cat >> confdefs.h <<\EOF
  762. #define NEED_SYS_TYPES_H 
  763. EOF
  764.  
  765. cat > conftest.$ac_ext <<EOF
  766. #line 767 "configure"
  767. #include "confdefs.h"
  768. #include <sys/types.h>
  769. EOF
  770. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  771.   egrep "size_t" >/dev/null 2>&1; then
  772.   rm -rf conftest*
  773.   ijg_size_t_ok="size_t is in sys/types.h"
  774. else
  775.   rm -rf conftest*
  776.   ijg_size_t_ok=no
  777. fi
  778. rm -f conftest*
  779.  
  780. else
  781.   echo "$ac_t""no" 1>&4
  782. ijg_size_t_ok=no
  783. fi
  784.  
  785. echo "$ac_t""$ijg_size_t_ok" 1>&4
  786. if test "$ijg_size_t_ok" = no; then
  787.   echo Type size_t is not defined in any of the usual places.
  788.   echo Try putting '"typedef unsigned int size_t;"' in jconfig.h.
  789. fi
  790. fi
  791. echo $ac_n "checking for type unsigned char""... $ac_c" 1>&4
  792. cat > conftest.$ac_ext <<EOF
  793. #line 794 "configure"
  794. #include "confdefs.h"
  795.  
  796. int main() { return 0; }
  797. int t() {
  798.  unsigned char un_char; 
  799. ; return 0; }
  800. EOF
  801. if eval $ac_compile; then
  802.   rm -rf conftest*
  803.   echo "$ac_t""yes" 1>&4
  804. cat >> confdefs.h <<\EOF
  805. #define HAVE_UNSIGNED_CHAR 
  806. EOF
  807.  
  808. else
  809.   rm -rf conftest*
  810.   echo "$ac_t""no" 1>&4
  811. fi
  812. rm -f conftest*
  813. echo $ac_n "checking for type unsigned short""... $ac_c" 1>&4
  814. cat > conftest.$ac_ext <<EOF
  815. #line 816 "configure"
  816. #include "confdefs.h"
  817.  
  818. int main() { return 0; }
  819. int t() {
  820.  unsigned short un_short; 
  821. ; return 0; }
  822. EOF
  823. if eval $ac_compile; then
  824.   rm -rf conftest*
  825.   echo "$ac_t""yes" 1>&4
  826. cat >> confdefs.h <<\EOF
  827. #define HAVE_UNSIGNED_SHORT 
  828. EOF
  829.  
  830. else
  831.   rm -rf conftest*
  832.   echo "$ac_t""no" 1>&4
  833. fi
  834. rm -f conftest*
  835. echo $ac_n "checking for type void""... $ac_c" 1>&4
  836. cat > conftest.$ac_ext <<EOF
  837. #line 838 "configure"
  838. #include "confdefs.h"
  839.  
  840. /* Caution: a C++ compiler will insist on valid prototypes */
  841. typedef void * void_ptr;    /* check void * */
  842. #ifdef HAVE_PROTOTYPES        /* check ptr to function returning void */
  843. typedef void (*void_func) (int a, int b);
  844. #else
  845. typedef void (*void_func) ();
  846. #endif
  847.  
  848. #ifdef HAVE_PROTOTYPES        /* check void function result */
  849. void test3function (void_ptr arg1, void_func arg2)
  850. #else
  851. void test3function (arg1, arg2)
  852.      void_ptr arg1;
  853.      void_func arg2;
  854. #endif
  855. {
  856.   char * locptr = (char *) arg1; /* check casting to and from void * */
  857.   arg1 = (void *) locptr;
  858.   (*arg2) (1, 2);        /* check call of fcn returning void */
  859. }
  860.  
  861. int main() { return 0; }
  862. int t() {
  863.  
  864. ; return 0; }
  865. EOF
  866. if eval $ac_compile; then
  867.   rm -rf conftest*
  868.   echo "$ac_t""yes" 1>&4
  869. else
  870.   rm -rf conftest*
  871.   echo "$ac_t""no" 1>&4
  872. cat >> confdefs.h <<\EOF
  873. #define void char
  874. EOF
  875.  
  876. fi
  877. rm -f conftest*
  878. echo $ac_n "checking for working const""... $ac_c" 1>&4
  879. if eval "test \"`echo '${'ac_cv_c_const'+set}'`\" = set"; then
  880.   echo $ac_n "(cached) $ac_c" 1>&4
  881. else
  882.   cat > conftest.$ac_ext <<EOF
  883. #line 884 "configure"
  884. #include "confdefs.h"
  885.  
  886. int main() { return 0; }
  887. int t() {
  888.  
  889. /* Ultrix mips cc rejects this.  */
  890. typedef int charset[2]; const charset x;
  891. /* SunOS 4.1.1 cc rejects this.  */
  892. char const *const *ccp;
  893. char **p;
  894. /* NEC SVR4.0.2 mips cc rejects this.  */
  895. struct point {int x, y;};
  896. static struct point const zero;
  897. /* AIX XL C 1.02.0.0 rejects this.
  898.    It does not let you subtract one const X* pointer from another in an arm
  899.    of an if-expression whose if-part is not a constant expression */
  900. const char *g = "string";
  901. ccp = &g + (g ? g-g : 0);
  902. /* HPUX 7.0 cc rejects these. */
  903. ++ccp;
  904. p = (char**) ccp;
  905. ccp = (char const *const *) p;
  906. { /* SCO 3.2v4 cc rejects this.  */
  907.   char *t;
  908.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  909.  
  910.   *t++ = 0;
  911. }
  912. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  913.   int x[] = {25, 17};
  914.   const int *foo = &x[0];
  915.   ++foo;
  916. }
  917. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  918.   typedef const int *iptr;
  919.   iptr p = 0;
  920.   ++p;
  921. }
  922. { /* AIX XL C 1.02.0.0 rejects this saying
  923.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  924.   struct s { int j; const int *ap[3]; };
  925.   struct s *b; b->j = 5;
  926. }
  927. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  928.   const int foo = 10;
  929. }
  930.  
  931. ; return 0; }
  932. EOF
  933. if eval $ac_compile; then
  934.   rm -rf conftest*
  935.   ac_cv_c_const=yes
  936. else
  937.   rm -rf conftest*
  938.   ac_cv_c_const=no
  939. fi
  940. rm -f conftest*
  941.  
  942. fi
  943. echo "$ac_t""$ac_cv_c_const" 1>&4
  944. if test $ac_cv_c_const = no; then
  945.   cat >> confdefs.h <<\EOF
  946. #define const 
  947. EOF
  948.  
  949. fi
  950.  
  951. echo $ac_n "checking for inline""... $ac_c" 1>&4
  952. ijg_cv_inline=""
  953. cat > conftest.$ac_ext <<EOF
  954. #line 955 "configure"
  955. #include "confdefs.h"
  956.  
  957. int main() { return 0; }
  958. int t() {
  959. } inline int foo() { return 0; }
  960. int bar() { return foo();
  961. ; return 0; }
  962. EOF
  963. if eval $ac_compile; then
  964.   rm -rf conftest*
  965.   ijg_cv_inline="inline"
  966. else
  967.   rm -rf conftest*
  968.   cat > conftest.$ac_ext <<EOF
  969. #line 970 "configure"
  970. #include "confdefs.h"
  971.  
  972. int main() { return 0; }
  973. int t() {
  974. } __inline__ int foo() { return 0; }
  975. int bar() { return foo();
  976. ; return 0; }
  977. EOF
  978. if eval $ac_compile; then
  979.   rm -rf conftest*
  980.   ijg_cv_inline="__inline__"
  981. else
  982.   rm -rf conftest*
  983.   cat > conftest.$ac_ext <<EOF
  984. #line 985 "configure"
  985. #include "confdefs.h"
  986.  
  987. int main() { return 0; }
  988. int t() {
  989. } __inline int foo() { return 0; }
  990. int bar() { return foo();
  991. ; return 0; }
  992. EOF
  993. if eval $ac_compile; then
  994.   rm -rf conftest*
  995.   ijg_cv_inline="__inline"
  996. fi
  997. rm -f conftest*
  998.  
  999. fi
  1000. rm -f conftest*
  1001.  
  1002. fi
  1003. rm -f conftest*
  1004. echo "$ac_t""$ijg_cv_inline" 1>&4
  1005. cat >> confdefs.h <<EOF
  1006. #define INLINE $ijg_cv_inline
  1007. EOF
  1008. echo $ac_n "checking for broken incomplete types""... $ac_c" 1>&4
  1009. cat > conftest.$ac_ext <<EOF
  1010. #line 1011 "configure"
  1011. #include "confdefs.h"
  1012.  typedef struct undefined_structure * undef_struct_ptr; 
  1013. int main() { return 0; }
  1014. int t() {
  1015.  
  1016. ; return 0; }
  1017. EOF
  1018. if eval $ac_compile; then
  1019.   rm -rf conftest*
  1020.   echo "$ac_t""ok" 1>&4
  1021. else
  1022.   rm -rf conftest*
  1023.   echo "$ac_t""broken" 1>&4
  1024. cat >> confdefs.h <<\EOF
  1025. #define INCOMPLETE_TYPES_BROKEN 
  1026. EOF
  1027.  
  1028. fi
  1029. rm -f conftest*
  1030. echo $ac_n "checking for short external names""... $ac_c" 1>&4
  1031. cat > conftest.$ac_ext <<EOF
  1032. #line 1033 "configure"
  1033. #include "confdefs.h"
  1034.  
  1035. int possibly_duplicate_function () { return 0; }
  1036. int possibly_dupli_function () { return 1; }
  1037.  
  1038. int main() { return 0; }
  1039. int t() {
  1040.  
  1041. ; return 0; }
  1042. EOF
  1043. if eval $ac_link; then
  1044.   rm -rf conftest*
  1045.   echo "$ac_t""ok" 1>&4
  1046. else
  1047.   rm -rf conftest*
  1048.   echo "$ac_t""short" 1>&4
  1049. cat >> confdefs.h <<\EOF
  1050. #define NEED_SHORT_EXTERNAL_NAMES 
  1051. EOF
  1052.  
  1053. fi
  1054. rm -f conftest*
  1055.  
  1056. echo $ac_n "checking to see if char is signed""... $ac_c" 1>&4
  1057. if test "$cross_compiling" = yes; then
  1058.   echo Assuming that char is signed on target machine.
  1059. echo If it is unsigned, this will be a little bit inefficient.
  1060.  
  1061. else
  1062. cat > conftest.$ac_ext <<EOF
  1063. #line 1064 "configure"
  1064. #include "confdefs.h"
  1065.  
  1066. #ifdef HAVE_PROTOTYPES
  1067. int is_char_signed (int arg)
  1068. #else
  1069. int is_char_signed (arg)
  1070.      int arg;
  1071. #endif
  1072. {
  1073.   if (arg == 189) {        /* expected result for unsigned char */
  1074.     return 0;            /* type char is unsigned */
  1075.   }
  1076.   else if (arg != -67) {    /* expected result for signed char */
  1077.     printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
  1078.     printf("I fear the JPEG software will not work at all.\n\n");
  1079.   }
  1080.   return 1;            /* assume char is signed otherwise */
  1081. }
  1082. char signed_char_check = (char) (-67);
  1083. main() {
  1084.   exit(is_char_signed((int) signed_char_check));
  1085. }
  1086. EOF
  1087. eval $ac_link
  1088. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1089.   echo "$ac_t""no" 1>&4
  1090. cat >> confdefs.h <<\EOF
  1091. #define CHAR_IS_UNSIGNED 
  1092. EOF
  1093.  
  1094. else
  1095.   echo "$ac_t""yes" 1>&4
  1096. fi
  1097. fi
  1098. rm -fr conftest*
  1099. echo $ac_n "checking to see if right shift is signed""... $ac_c" 1>&4
  1100. if test "$cross_compiling" = yes; then
  1101.   echo "$ac_t""Assuming that right shift is signed on target machine." 1>&4
  1102. else
  1103. cat > conftest.$ac_ext <<EOF
  1104. #line 1105 "configure"
  1105. #include "confdefs.h"
  1106.  
  1107. #ifdef HAVE_PROTOTYPES
  1108. int is_shifting_signed (long arg)
  1109. #else
  1110. int is_shifting_signed (arg)
  1111.      long arg;
  1112. #endif
  1113. /* See whether right-shift on a long is signed or not. */
  1114. {
  1115.   long res = arg >> 4;
  1116.  
  1117.   if (res == -0x7F7E80CL) {    /* expected result for signed shift */
  1118.     return 1;            /* right shift is signed */
  1119.   }
  1120.   /* see if unsigned-shift hack will fix it. */
  1121.   /* we can't just test exact value since it depends on width of long... */
  1122.   res |= (~0L) << (32-4);
  1123.   if (res == -0x7F7E80CL) {    /* expected result now? */
  1124.     return 0;            /* right shift is unsigned */
  1125.   }
  1126.   printf("Right shift isn't acting as I expect it to.\n");
  1127.   printf("I fear the JPEG software will not work at all.\n\n");
  1128.   return 0;            /* try it with unsigned anyway */
  1129. }
  1130. main() {
  1131.   exit(is_shifting_signed(-0x7F7E80B1L));
  1132. }
  1133. EOF
  1134. eval $ac_link
  1135. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1136.   echo "$ac_t""no" 1>&4
  1137. cat >> confdefs.h <<\EOF
  1138. #define RIGHT_SHIFT_IS_UNSIGNED 
  1139. EOF
  1140.  
  1141. else
  1142.   echo "$ac_t""yes" 1>&4
  1143. fi
  1144. fi
  1145. rm -fr conftest*
  1146. echo $ac_n "checking to see if fopen accepts b spec""... $ac_c" 1>&4
  1147. if test "$cross_compiling" = yes; then
  1148.   echo "$ac_t""Assuming that it does." 1>&4
  1149. else
  1150. cat > conftest.$ac_ext <<EOF
  1151. #line 1152 "configure"
  1152. #include "confdefs.h"
  1153.  
  1154. #include <stdio.h>
  1155. main() {
  1156.   if (fopen("conftestdata", "wb") != NULL)
  1157.     exit(0);
  1158.   exit(1);
  1159. }
  1160. EOF
  1161. eval $ac_link
  1162. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1163.   echo "$ac_t""yes" 1>&4
  1164. else
  1165.   echo "$ac_t""no" 1>&4
  1166. cat >> confdefs.h <<\EOF
  1167. #define DONT_USE_B_MODE 
  1168. EOF
  1169.  
  1170. fi
  1171. fi
  1172. rm -fr conftest*
  1173.  
  1174. # Find a good install program.  We prefer a C program (faster),
  1175. # so one script is as good as another.  But avoid the broken or
  1176. # incompatible versions:
  1177. # SysV /etc/install, /usr/sbin/install
  1178. # SunOS /usr/etc/install
  1179. # IRIX /sbin/install
  1180. # AIX /bin/install
  1181. # AFS /usr/afsws/bin/install, which mishandles nonexistent args
  1182. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  1183. # ./install, which can be erroneously created by make from ./install.sh.
  1184. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&4
  1185. if test -z "$INSTALL"; then
  1186. if eval "test \"`echo '${'ijg_cv_path_install'+set}'`\" = set"; then
  1187.   echo $ac_n "(cached) $ac_c" 1>&4
  1188. else
  1189.     IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  1190.   for ac_dir in $PATH; do
  1191.     case "$ac_dir" in
  1192.     ''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;;
  1193.     *)
  1194.       # OSF1 and SCO ODT 3.0 have their own names for install.
  1195.       for ac_prog in ginstall installbsd scoinst install; do
  1196.         if test -f $ac_dir/$ac_prog; then
  1197.       if test $ac_prog = install &&
  1198.             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  1199.         # AIX install.  It has an incompatible calling convention.
  1200.         # OSF/1 installbsd also uses dspmsg, but is usable.
  1201.         :
  1202.       else
  1203.         ijg_cv_path_install="$ac_dir/$ac_prog -c"
  1204.         break 2
  1205.       fi
  1206.     fi
  1207.       done
  1208.       ;;
  1209.     esac
  1210.   done
  1211.   IFS="$ac_save_ifs"
  1212.   # As a last resort, use cp
  1213.   test -z "$ijg_cv_path_install" && ijg_cv_path_install="cp"
  1214. fi
  1215.   INSTALL="$ijg_cv_path_install"
  1216. fi
  1217. echo "$ac_t""$INSTALL" 1>&4
  1218.  
  1219. # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
  1220. # It thinks the first close brace ends the variable substitution.
  1221. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='$(INSTALL)'
  1222.  
  1223. if test -z "$INSTALL_DATA"; then
  1224.   if test "$INSTALL" = cp; then
  1225.     INSTALL_DATA='$(INSTALL)'
  1226.   else
  1227.     INSTALL_DATA='$(INSTALL) -m 644'
  1228.   fi
  1229. fi
  1230.  
  1231. # Extract the first word of "ranlib", so it can be a program name with args.
  1232. set dummy ranlib; ac_word=$2
  1233. echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
  1234. if eval "test \"`echo '${'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  1235.   echo $ac_n "(cached) $ac_c" 1>&4
  1236. else
  1237.   if test -n "$RANLIB"; then
  1238.   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
  1239. else
  1240.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  1241.   for ac_dir in $PATH; do
  1242.     test -z "$ac_dir" && ac_dir=.
  1243.     if test -f $ac_dir/$ac_word; then
  1244.       ac_cv_prog_RANLIB="ranlib"
  1245.       break
  1246.     fi
  1247.   done
  1248.   IFS="$ac_save_ifs"
  1249.   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
  1250. fi
  1251. fi
  1252. RANLIB="$ac_cv_prog_RANLIB"
  1253. if test -n "$RANLIB"; then
  1254.   echo "$ac_t""$RANLIB" 1>&4
  1255. else
  1256.   echo "$ac_t""no" 1>&4
  1257. fi
  1258.  
  1259. MEMORYMGR="jmemnobs.o"
  1260. MAXMEM="no"
  1261. # Check whether --enable-maxmem or --disable-maxmem was given.
  1262. enableval="$enable_maxmem"
  1263. if test -n "$enableval"; then
  1264.   MAXMEM="$enableval"
  1265. fi
  1266.  
  1267. # support --with-maxmem for backwards compatibility with IJG V5.
  1268. # Check whether --with-maxmem or --without-maxmem was given.
  1269. withval="$with_maxmem"
  1270. if test -n "$withval"; then
  1271.   MAXMEM="$withval"
  1272. fi
  1273.  
  1274. if test "x$MAXMEM" = xyes; then
  1275.   MAXMEM=1
  1276. fi
  1277. if test "x$MAXMEM" != xno; then
  1278.   if test -n "`echo $MAXMEM | sed 's/[0-9]//g'`"; then
  1279.     { echo "configure: error: non-numeric argument to --enable-maxmem" 1>&2; exit 1; }
  1280.   fi
  1281.   DEFAULTMAXMEM=`expr $MAXMEM \* 1048576`
  1282. cat >> confdefs.h <<EOF
  1283. #define DEFAULT_MAX_MEM ${DEFAULTMAXMEM}
  1284. EOF
  1285.  
  1286. echo $ac_n "checking for 'tmpfile()'""... $ac_c" 1>&4
  1287. cat > conftest.$ac_ext <<EOF
  1288. #line 1289 "configure"
  1289. #include "confdefs.h"
  1290. #include <stdio.h>
  1291. int main() { return 0; }
  1292. int t() {
  1293.  FILE * tfile = tmpfile(); 
  1294. ; return 0; }
  1295. EOF
  1296. if eval $ac_link; then
  1297.   rm -rf conftest*
  1298.   echo "$ac_t""yes" 1>&4
  1299. MEMORYMGR="jmemansi.o"
  1300. else
  1301.   rm -rf conftest*
  1302.   echo "$ac_t""no" 1>&4
  1303. MEMORYMGR="jmemname.o"
  1304. cat >> confdefs.h <<\EOF
  1305. #define NEED_SIGNAL_CATCHER 
  1306. EOF
  1307. echo $ac_n "checking for 'mktemp()'""... $ac_c" 1>&4
  1308. cat > conftest.$ac_ext <<EOF
  1309. #line 1310 "configure"
  1310. #include "confdefs.h"
  1311.  
  1312. int main() { return 0; }
  1313. int t() {
  1314.  char fname[80]; mktemp(fname); 
  1315. ; return 0; }
  1316. EOF
  1317. if eval $ac_link; then
  1318.   rm -rf conftest*
  1319.   echo "$ac_t""yes" 1>&4
  1320. else
  1321.   rm -rf conftest*
  1322.   echo "$ac_t""no" 1>&4
  1323. cat >> confdefs.h <<\EOF
  1324. #define NO_MKTEMP 
  1325. EOF
  1326.  
  1327. fi
  1328. rm -f conftest*
  1329.  
  1330. fi
  1331. rm -f conftest*
  1332.  
  1333. fi
  1334.  
  1335. # Prepare to massage makefile.cfg correctly.
  1336. if test $ijg_cv_have_prototypes = yes; then
  1337.   ANSI2KNR=""
  1338.   ISANSICOM="# "
  1339. else
  1340.   ANSI2KNR="ansi2knr"
  1341.   ISANSICOM=""
  1342. fi
  1343. # ansi2knr needs -DBSD if string.h is missing
  1344. if test $ac_cv_header_string_h = no; then
  1345.   ANSI2KNRFLAGS="-DBSD"
  1346. else
  1347.   ANSI2KNRFLAGS=""
  1348. fi
  1349. # Set up -I directives
  1350. if test "x$srcdir" = x.; then
  1351.   INCLUDEFLAGS='-I$(srcdir)'
  1352. else
  1353.   INCLUDEFLAGS='-I. -I$(srcdir)'
  1354. fi
  1355. trap '' 1 2 15
  1356.  
  1357. trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
  1358.  
  1359. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  1360. # Let make expand exec_prefix.
  1361. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  1362.  
  1363. # Any assignment to VPATH causes Sun make to only execute
  1364. # the first set of double-colon rules, so remove it if not needed.
  1365. # If there is a colon in the path, we need to keep it.
  1366. if test "x$srcdir" = x.; then
  1367.   ac_vpsub='/^[     ]*VPATH[     ]*=[^:]*$/d'
  1368. fi
  1369.  
  1370. trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
  1371.  
  1372. DEFS=-DHAVE_CONFIG_H
  1373.  
  1374. # Without the "./", some shells look in PATH for config.status.
  1375. : ${CONFIG_STATUS=./config.status}
  1376.  
  1377. echo creating $CONFIG_STATUS
  1378. rm -f $CONFIG_STATUS
  1379. cat > $CONFIG_STATUS <<EOF
  1380. #!/bin/sh
  1381. # Generated automatically by configure.
  1382. # Run this file to recreate the current configuration.
  1383. # This directory was configured as follows,
  1384. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1385. #
  1386. # $0 $ac_configure_args
  1387. #
  1388. # Compiler output produced by configure, useful for debugging
  1389. # configure, is in ./config.log if it exists.
  1390.  
  1391. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
  1392. for ac_option
  1393. do
  1394.   case "\$ac_option" in
  1395.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1396.     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
  1397.     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  1398.   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
  1399.     echo "$CONFIG_STATUS generated by autoconf version 2.1"
  1400.     exit 0 ;;
  1401.   -help | --help | --hel | --he | --h)
  1402.     echo "\$ac_cs_usage"; exit 0 ;;
  1403.   *) echo "\$ac_cs_usage"; exit 1 ;;
  1404.   esac
  1405. done
  1406.  
  1407. ac_given_srcdir=$srcdir
  1408.  
  1409. trap 'rm -fr Makefile:makefile.cfg jconfig.h:jconfig.cfg conftest*; exit 1' 1 2 15
  1410.  
  1411. # Protect against being on the right side of a sed subst in config.status. 
  1412. sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; 
  1413.  s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
  1414. $ac_vpsub
  1415. $extrasub
  1416. s%@CFLAGS@%$CFLAGS%g
  1417. s%@CPPFLAGS@%$CPPFLAGS%g
  1418. s%@CXXFLAGS@%$CXXFLAGS%g
  1419. s%@DEFS@%$DEFS%g
  1420. s%@LDFLAGS@%$LDFLAGS%g
  1421. s%@LIBS@%$LIBS%g
  1422. s%@exec_prefix@%$exec_prefix%g
  1423. s%@prefix@%$prefix%g
  1424. s%@program_transform_name@%$program_transform_name%g
  1425. s%@CC@%$CC%g
  1426. s%@CPP@%$CPP%g
  1427. s%@INSTALL@%$INSTALL%g
  1428. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1429. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1430. s%@RANLIB@%$RANLIB%g
  1431. s%@MEMORYMGR@%$MEMORYMGR%g
  1432. s%@ANSI2KNR@%$ANSI2KNR%g
  1433. s%@ISANSICOM@%$ISANSICOM%g
  1434. s%@ANSI2KNRFLAGS@%$ANSI2KNRFLAGS%g
  1435. s%@INCLUDEFLAGS@%$INCLUDEFLAGS%g
  1436.  
  1437. CEOF
  1438. EOF
  1439. cat >> $CONFIG_STATUS <<EOF
  1440.  
  1441. CONFIG_FILES=\${CONFIG_FILES-"Makefile:makefile.cfg"}
  1442. EOF
  1443. cat >> $CONFIG_STATUS <<\EOF
  1444. for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  1445.   # Support "outfile[:infile]", defaulting infile="outfile.in".
  1446.   case "$ac_file" in
  1447.   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
  1448.        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  1449.   *) ac_file_in="${ac_file}.in" ;;
  1450.   esac
  1451.  
  1452.   # Adjust relative srcdir, etc. for subdirectories.
  1453.  
  1454.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1455.   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  1456.   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
  1457.     # The file is in a subdirectory.
  1458.     test ! -d "$ac_dir" && mkdir "$ac_dir"
  1459.     ac_dir_suffix="/$ac_dir"
  1460.     # A "../" for each directory in $ac_dir_suffix.
  1461.     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  1462.   else
  1463.     ac_dir_suffix= ac_dots=
  1464.   fi
  1465.  
  1466.   case "$ac_given_srcdir" in
  1467.   .)  srcdir=.
  1468.       if test -z "$ac_dots"; then top_srcdir=.
  1469.       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  1470.   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  1471.   *) # Relative path.
  1472.     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
  1473.     top_srcdir="$ac_dots$ac_given_srcdir" ;;
  1474.   esac
  1475.  
  1476.   echo creating "$ac_file"
  1477.   rm -f "$ac_file"
  1478.   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  1479.   case "$ac_file" in
  1480.   *Makefile*) ac_comsub="1i\\
  1481. # $configure_input" ;;
  1482.   *) ac_comsub= ;;
  1483.   esac
  1484.   sed -e "$ac_comsub
  1485. s%@configure_input@%$configure_input%g
  1486. s%@srcdir@%$srcdir%g
  1487. s%@top_srcdir@%$top_srcdir%g
  1488. " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
  1489. fi; done
  1490. rm -f conftest.subs
  1491.  
  1492. # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
  1493. # NAME is the cpp macro being defined and VALUE is the value it is being given.
  1494. #
  1495. # ac_d sets the value in "#define NAME VALUE" lines.
  1496. ac_dA='s%^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1497. ac_dB='\([     ][     ]*\)[^     ]*%\1#\2'
  1498. ac_dC='\3'
  1499. ac_dD='%g'
  1500. # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1501. ac_uA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1502. ac_uB='\([     ]\)%\1#\2define\3'
  1503. ac_uC=' '
  1504. ac_uD='\4%g'
  1505. # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1506. ac_eA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1507. ac_eB='$%\1#\2define\3'
  1508. ac_eC=' '
  1509. ac_eD='%g'
  1510.  
  1511. CONFIG_HEADERS=${CONFIG_HEADERS-"jconfig.h:jconfig.cfg"}
  1512. for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  1513.   # Support "outfile[:infile]", defaulting infile="outfile.in".
  1514.   case "$ac_file" in
  1515.   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
  1516.        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  1517.   *) ac_file_in="${ac_file}.in" ;;
  1518.   esac
  1519.  
  1520.   echo creating $ac_file
  1521.  
  1522.   rm -f conftest.frag conftest.in conftest.out
  1523.   cp $ac_given_srcdir/$ac_file_in conftest.in
  1524.  
  1525. EOF
  1526.  
  1527. # Transform confdefs.h into a sed script conftest.vals that substitutes
  1528. # the proper values into config.h.in to produce config.h.  And first:
  1529. # Protect against being on the right side of a sed subst in config.status. 
  1530. # Protect against being in an unquoted here document in config.status.
  1531. rm -f conftest.vals
  1532. cat > conftest.hdr <<\EOF
  1533. s/[\\&%]/\\&/g
  1534. s%[\\$`]%\\&%g
  1535. s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
  1536. s%ac_d%ac_u%gp
  1537. s%ac_u%ac_e%gp
  1538. EOF
  1539. sed -n -f conftest.hdr confdefs.h > conftest.vals
  1540. rm -f conftest.hdr
  1541.  
  1542. # This sed command replaces #undef with comments.  This is necessary, for
  1543. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1544. # on some systems where configure will not decide to define it.
  1545. cat >> conftest.vals <<\EOF
  1546. EOF
  1547.  
  1548. # Break up conftest.vals because some shells have a limit on
  1549. # the size of here documents, and old seds have small limits too.
  1550. # Maximum number of lines to put in a single here document.
  1551. ac_max_here_lines=12
  1552.  
  1553. rm -f conftest.tail
  1554. while :
  1555. do
  1556.   ac_lines=`grep -c . conftest.vals`
  1557.   # grep -c gives empty output for an empty file on some AIX systems.
  1558.   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  1559.   # Write a limited-size here document to conftest.frag.
  1560.   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  1561.   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  1562.   echo 'CEOF
  1563.   sed -f conftest.frag conftest.in > conftest.out
  1564.   rm -f conftest.in
  1565.   mv conftest.out conftest.in
  1566. ' >> $CONFIG_STATUS
  1567.   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  1568.   rm -f conftest.vals
  1569.   mv conftest.tail conftest.vals
  1570. done
  1571. rm -f conftest.vals
  1572.  
  1573. cat >> $CONFIG_STATUS <<\EOF
  1574.   rm -f conftest.frag conftest.h
  1575.   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  1576.   cat conftest.in >> conftest.h
  1577.   rm -f conftest.in
  1578.   if cmp -s $ac_file conftest.h 2>/dev/null; then
  1579.     echo "$ac_file is unchanged"
  1580.     rm -f conftest.h
  1581.   else
  1582.     rm -f $ac_file
  1583.     mv conftest.h $ac_file
  1584.   fi
  1585. fi; done
  1586.  
  1587.  
  1588.  
  1589. exit 0
  1590. EOF
  1591. chmod +x $CONFIG_STATUS
  1592. rm -fr confdefs* $ac_clean_files
  1593. test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
  1594.  
  1595.